#include <iostream>
#include <stdlib.h>
using namespace std;

typedef struct 
{
   int date[1000001];
   int len;
}Sqlist;
void Create_Sqlist(Sqlist *&list, int len)
{
    list = (Sqlist*)malloc(sizeof(Sqlist));
    for (int i = 0; i < len; i++) {
        cin >>list->date[i];
    }
    list->len = len;
}
void delete_extral_elements(Sqlist *&lsit)
{
    int j = 0;
    for (int i = 1; i < lsit->len; i++) {
       if (lsit->date[j]!=lsit->date[i]) {
           lsit->date[++j] = lsit->date[i];
           lsit->date[j]   = lsit->date[i];
       }
    }
    lsit->len = j+1;
}
void display(Sqlist *&list)
{
    for (int i = 0; i < list->len; i++) {
        cout <<list->date[i] <<" ";
    } 
}

int main()
{
    Sqlist *list;
    int n;
    cin >>n;
    Create_Sqlist(list,n);
    delete_extral_elements(list);
    display(list);
}
